package afcp.alumni.model;

import java.nio.charset.Charset;
import java.util.Map;

import afcp.alumni.util.Charsets;

public class CsvFileProperties {
	
	private static final Charset DEFAULT_CHARSET = Charsets.CP1252.getCharset();
	
	private String charset;
	private char separator;
	private char quote;
	private char escape;
	private Map<String, String> headers;
	
	public CsvFileProperties() {
	}
	
	public CsvFileProperties(String charset, char separator, char quote, char escape,
			Map<String, String> headers) {
		super();
		this.charset = charset;
		this.separator = separator;
		this.quote = quote;
		this.escape = escape;
		this.headers = headers;
	}

	public String getCharset() {
		return charset;
	}
	public Charset getCharsetObj() {
		try {
			return Charset.forName(charset);
		} catch (Exception e1) {
			return DEFAULT_CHARSET;
		}
	}
	public void setCharset(String charset) {
		this.charset = charset;
	}
	public char getSeparator() {
		return separator;
	}
	public void setSeparator(char separator) {
		this.separator = separator;
	}
	public char getQuote() {
		return quote;
	}
	public void setQuote(char quote) {
		this.quote = quote;
	}
	public char getEscape() {
		return escape;
	}
	public void setEscape(char escape) {
		this.escape = escape;
	}
	public Map<String, String> getHeaders() {
		return headers;
	}
	public void setHeaders(Map<String, String> headers) {
		this.headers = headers;
	}

}
